package com.spring.nio.core.configuration;

import lombok.Data;

import java.net.InetSocketAddress;
import java.nio.channels.ServerSocketChannel;

/**
 * @author: YSFY
 * @date: 2021-03-24 20:09
 * @pacage_name: com.spring.nio.core.configuration
 * @class_name: AcceptorEntity
 * @description: acceptor实体类
 */

public final class AcceptorEntity {

    private String acceptorName;

    private InetSocketAddress inetSocketAddress;

    private ServerSocketChannel serverSocketChannel;

    private Thread thread;

    private Runnable acceptorRunnable;

    public static AcceptorEntity getInstance() {
        return new AcceptorEntity();
    }

    public String getAcceptorName() {
        return acceptorName;
    }

    public AcceptorEntity setAcceptorName(String acceptorName) {
        this.acceptorName = acceptorName;
        return this;
    }

    public InetSocketAddress getInetSocketAddress() {
        return inetSocketAddress;
    }

    public AcceptorEntity setInetSocketAddress(InetSocketAddress inetSocketAddress) {
        this.inetSocketAddress = inetSocketAddress;
        return this;
    }

    public ServerSocketChannel getServerSocketChannel() {
        return serverSocketChannel;
    }

    public AcceptorEntity setServerSocketChannel(ServerSocketChannel serverSocketChannel) {
        this.serverSocketChannel = serverSocketChannel;
        return this;
    }

    public Thread getThread() {
        return thread;
    }

    public AcceptorEntity setThread(Thread thread) {
        this.thread = thread;
        return this;
    }

    public Runnable getAcceptorRunnable() {
        return acceptorRunnable;
    }

    public AcceptorEntity setAcceptorRunnable(Runnable acceptorRunnable) {
        this.acceptorRunnable = acceptorRunnable;
        return this;
    }
}
